package com.producteev4j.model.request;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

/**
 * Created by IntelliJ IDEA.
 * User: jcarrey
 * Date: 16/05/11
 * Time: 19:12
 * To change this template use File | Settings | File Templates.
 */
public final class ProducteevDateUtil {

    private ProducteevDateUtil() {
    }

    private static final String RFC_RFC_2822_FORMAT = "EEE, d MMM yyyy H:mm:ss Z";
    private static final SimpleDateFormat format = new SimpleDateFormat(RFC_RFC_2822_FORMAT, Locale.ENGLISH);


    public static Date parseDateRFC(final String date) throws ParseException {
        return format.parse(date);
    }

    public static String formatDateRFC(final Date date) {
        return format.format(date);
    }

}
